package queries;

import java.sql.SQLException;
import java.sql.Statement;

import entitys.Category;
import enums.Result;

/**
 * updates the name of the product category in ccrm.category
 * @author Dima
 *
 */
public class EditCategoryQuery {
	
	public static Result exe(Category category,java.sql.Connection conn)
	{
		Statement stmt;
		try {
			stmt = conn.createStatement();
			stmt.executeUpdate("UPDATE `ccrm`.`category` SET `name`='"+category.getCategoryName()+"' WHERE `id`='"+category.getCategoryid()+"';");
			return Result.OK;
			
		} catch (SQLException e) {	return Result.ERROR;}
		
		
	}

}
